home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 03.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-07  |  7.2 KB  |  407 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. CropAnswerA = strip(line)
  30. line = readln(TempFile)
  31. PicBName = strip(line)
  32. line = readln(TempFile)
  33. StartB = strip(line)
  34. line = readln(TempFile)
  35. EndB = strip(line)
  36. line = readln(TempFile)
  37. IBType = strip(line)
  38. line = readln(TempFile)
  39. CropAnswerB = strip(line)
  40. line = readln(TempFile)
  41. PicCName = strip(line)
  42. line = readln(TempFile)
  43. StartC = strip(line)
  44. line = readln(TempFile)
  45. EndC = strip(line)
  46. line = readln(TempFile)
  47. ICType = strip(line)
  48. line = readln(TempFile)
  49. CropAnswerC = strip(line)
  50. line = readln(TempFile)
  51. PicDName = strip(line)
  52. line = readln(TempFile)
  53. StartD = strip(line)
  54. line = readln(TempFile)
  55. EndD = strip(line)
  56. line = readln(TempFile)
  57. IDType = strip(line)
  58. line = readln(TempFile)
  59. CropAnswerD = strip(line)
  60. line = readln(TempFile)
  61. Fifth = strip(line)
  62. line = readln(TempFile)
  63. Shadow = strip(line)
  64. line = readln(TempFile)
  65. PicEName = strip(line)
  66. line = readln(TempFile)
  67. StartE = strip(line)
  68. line = readln(TempFile)
  69. EndE = strip(line)
  70. line = readln(TempFile)
  71. IEType = strip(line)
  72. line = readln(TempFile)
  73. CropAnswerE = strip(line)
  74. line = readln(TempFile)
  75. Bevel = strip(line)
  76. line = readln(TempFile)
  77. BevelNum = strip(line)
  78. call close TempFile
  79.  
  80. Frames = (End - Start)+1
  81. j=0
  82. k=0
  83. TFrames = Frames
  84. TNum = 3
  85. if TFrames > 999 then TNum = 4
  86. if TFrames > 9999 then TNum = 5
  87. if Field = 1 then TFrames = Frames*2
  88. do i = Start to End
  89.     k = k + 1
  90.     call open TempFile,"RAM:VFXNums",W
  91.     call writeln TempFile,right(k,5,'0')
  92.     call writeln TempFile,right(Frames,5,'0')
  93.     call close TempFile
  94.     f=0
  95.     Redraw Off
  96.     j = j+ 1
  97.     call DoIt()
  98.     Redraw On
  99.     call SaveIt()
  100.         if Field = 1 then do
  101.             Redraw Off
  102.             j = j + 1
  103.             call DoIt()
  104.             Redraw On
  105.             call SaveIt()
  106.             end 
  107.     end
  108.     Undo On
  109. exit
  110.  
  111.  
  112. LoadA:
  113.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  114.         Undo On
  115.         exit
  116.         end
  117.     if IAType = 0 then do
  118.         LoadBuffer PicAName Force i
  119.         end
  120.     if IAType = 1 then do
  121.         LoadBuffer PicAName Force 1
  122.         end
  123.     if IAType = 2 then do
  124.         LoadBuffer PicAName Force
  125.         end
  126.     if IAType = 3 then do
  127.         LoadBuffer PicAName""right(i,TNum,'0') Force
  128.         end
  129. return
  130.  
  131. LoadB:
  132.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  133.         Undo On
  134.         exit
  135.         end
  136.     if IBType = 0 then do
  137.         LoadBuffer PicBName Force (k+StartB)-1
  138.         end
  139.     if IBType = 1 then do
  140.         LoadBuffer PicBName Force 1
  141.         end
  142.     if IBType = 2 then do
  143.         LoadBuffer PicBName Force
  144.         end
  145.     if IBType = 3 then do
  146.         LoadBuffer PicBName""right((k+StartB)-1,TNum,'0') Force
  147.         end
  148. return
  149.  
  150. LoadC:
  151.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  152.         Undo On
  153.         exit
  154.         end
  155.     if ICType = 0 then do
  156.         LoadBuffer PicCName Force (k+StartC)-1
  157.         end
  158.     if ICType = 1 then do
  159.         LoadBuffer PicCName Force 1
  160.         end
  161.     if ICType = 2 then do
  162.         LoadBuffer PicCName Force
  163.         end
  164.     if ICType = 3 then do
  165.         LoadBuffer PicCName""right((k+StartC)-1,TNum,'0') Force
  166.         end
  167. return
  168.  
  169. LoadD:
  170.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  171.         Undo On
  172.         exit
  173.         end
  174.     if IDType = 0 then do
  175.         LoadBuffer PicDName Force (k+StartD)-1
  176.         end
  177.     if IDType = 1 then do
  178.         LoadBuffer PicDName Force 1
  179.         end
  180.     if IDType = 2 then do
  181.         LoadBuffer PicDName Force
  182.         end
  183.     if IDType = 3 then do
  184.         LoadBuffer PicDName""right((k+StartD)-1,TNum,'0') Force
  185.         end
  186. return
  187.  
  188.  
  189. LoadE:
  190.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  191.         Undo On
  192.         exit
  193.         end
  194.     if IEType = 0 then do
  195.         LoadBuffer PicEName Force (k+StartE)-1
  196.         end
  197.     if IEType = 1 then do
  198.         LoadBuffer PicEName Force 1
  199.         end
  200.     if IEType = 2 then do
  201.         LoadBuffer PicEName Force
  202.         end
  203.     if IEType = 3 then do
  204.         LoadBuffer PicEName""right((k+StartE)-1,TNum,'0') Force
  205.         end
  206. return
  207.  
  208.  
  209.  
  210. SaveIt:
  211.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  212.         Undo On
  213.         exit
  214.         end
  215.     if SaveType = 0 then do
  216.         call Switcher(TOSW)
  217.         call Switcher(MDV1)
  218.         Render Go
  219.         if Field = 1 then
  220.                 call RecordAdd(SaveName,1,6,Compression)
  221.         else
  222.                 call RecordAdd(SaveName,2,6,Compression)
  223.         if j = TFrames then
  224.             call MakeIcon(SaveName,(Frames-10))
  225.         end
  226.  
  227.     if SaveType = 1 then do
  228.         if Field = 1 then do
  229.             f= f + 1
  230.             if f = 1 then
  231.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  232.             if f = 2 then do
  233.                 GetMain
  234.                 parse var result Name Width Height Blah
  235.                 Scale Width Height/2
  236.                 Swap
  237.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  238.                 Scale Width Height/2
  239.                 Hook Interlace
  240.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  241.                 f = 0
  242.                 end
  243.             end
  244.         else do
  245.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  246.             end    
  247.         end
  248. return
  249.  
  250.  
  251.  
  252.  
  253. DoIt:
  254.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  255.         Undo On
  256.         exit
  257.         end
  258.     call LoadA()
  259.     GetMain
  260.     parse var result Name Width Height Blah
  261.     if CropAnswerA ~= "None" then do
  262.         CropAnswerA
  263.         Scale Width Height
  264.         end
  265.     Buffer2Swap
  266.     ClearBuffer 0 0 0 Force
  267.     Swap
  268.     Scale Width/2 Height/2
  269.     if Bevel = 1 then call BevelIt()
  270.     GetMain
  271.     parse var result Name Width2 Height2 Blah
  272.     Scissors
  273.     Region Brush
  274.     Box 0 0 Width2 Height2
  275.     BrushHandle 0 0
  276.     Swap
  277.     Point 0 0
  278.     KillBrush
  279.     Swap
  280.  
  281.     call LoadB()
  282.     if CropAnswerB ~= "None" then do
  283.         CropAnswerB
  284.         Scale Width Height
  285.         end
  286.     Scale Width/2 Height/2
  287.     if Bevel = 1 then call BevelIt()
  288.     Scissors
  289.     Region Brush
  290.     Box 0 0 Width/2 Height/2
  291.     BrushHandle 0 0
  292.     Swap
  293.     Point Width/2 0
  294.     KillBrush
  295.     Swap
  296.  
  297.  
  298.     call LoadC()
  299.     if CropAnswerC ~= "None" then do
  300.         CropAnswerC
  301.         Scale Width Height
  302.         end
  303.     Scale Width/2 Height/2
  304.     if Bevel = 1 then call BevelIt()
  305.     Scissors
  306.     Region Brush
  307.     Box 0 0 Width/2 Height/2
  308.     BrushHandle 0 0
  309.     Swap
  310.     Point 0 Height/2
  311.     KillBrush
  312.     Swap
  313.  
  314.     call LoadD()
  315.     if CropAnswerD ~= "None" then do
  316.         CropAnswerD
  317.         Scale Width Height
  318.         end
  319.     Scale Width/2 Height/2
  320.     if Bevel = 1 then call BevelIt()
  321.     Scissors
  322.     Region Brush
  323.     Box 0 0 Width/2 Height/2
  324.     BrushHandle 0 0
  325.     Swap
  326.     Point Width/2 Height/2
  327.     KillBrush
  328.  
  329.  
  330.     if Fifth = 1 then do
  331.         Swap
  332.         call LoadE()
  333.         if CropAnswerE ~= "None" then do
  334.             CropAnswerE
  335.             Scale Width Height
  336.             end
  337.         Scale Width/2 Height/2
  338.         if Bevel = 1 then call BevelIt()
  339.         Scissors
  340.         Region Brush
  341.         Box 0 0 Width/2 Height/2
  342.         BrushHandle 0 0
  343.         Swap
  344.         if Shadow = 1 then do
  345.             DrawMode Darken
  346.             Point (Width/4)+12 (Height/4)+10
  347.             DrawMode Normal
  348.             end
  349.         Point Width/4 Height/4
  350.         KillBrush
  351.     end
  352. return
  353.  
  354. BevelIt:
  355.     A = 0
  356.     B = 0
  357.     C = Width/2
  358.     D = Height/2
  359.     Depth = BevelNum
  360.     Blend 90
  361.     NewArea
  362.     DrawMode Lighten
  363.     C = C + A
  364.     D = D + B
  365.     AddArea A+1 B
  366.     AddArea C B
  367.     AddArea C-Depth+1 B+Depth-1
  368.     AddArea A+Depth B+Depth-1
  369.     AddArea A+1 B
  370.     FilledPoly
  371.  
  372.     NewArea
  373.     DrawMode Lighten
  374.     AddArea A B
  375.     AddArea A+Depth-1 B+Depth-1
  376.     AddArea A+Depth-1 D-Depth+1
  377.     AddArea A D
  378.     AddArea A B
  379.     FilledPoly
  380.     FilledPoly
  381.  
  382.     Blend 70
  383.     NewArea
  384.     DrawMode Darken
  385.     AddArea C-Depth+1 B+Depth 
  386.     AddArea C B+1
  387.     AddArea C D 
  388.     AddArea C-Depth+1 D-Depth+1
  389.     AddArea C-Depth+1 B+Depth
  390.     FilledPoly
  391.  
  392.     NewArea
  393.     DrawMode Darken
  394.     AddArea C-1 D
  395.     AddArea A+1 D
  396.     AddArea A+Depth D-Depth+1  
  397.     AddArea C-Depth D-Depth+1 
  398.     AddArea C-1 D
  399.     FilledPoly
  400.     FilledPoly
  401.  
  402.     Blend 100
  403.     DrawMode Normal
  404. return
  405.  
  406.  
  407.